<?php if(!empty($doanviens) && !empty($quyens)){?>
<table id='tables'>
<tr>
<th>STT</th>
<th>Họ tên</th>
<th>Chi đoàn</th>
<?php foreach ($quyens as $quyen_id=>$quyenval):?>
<th><?php echo $quyenval;?></th>
<?php endforeach;?>
</tr>
<?php foreach ($doanviens as $doanvien):?>
<?php $i=1;?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $doanvien[$tenloaidv]['name']?></td>
<td><?php echo $doanvien['Chidoansv']['tenchidoan']?></td>
<?php foreach ($quyens as $quyen_id=>$quyenval):?>
<td><?php if(isset($quyendvs[$doanvien[$tenloaidv][$maso]]))
		{
			if(in_array($quyenval, $quyendvs[$doanvien[$tenloaidv][$maso]]))
				echo $html->image($this->webroot.'../img/check.png');
                //echo 'X';		
		}
		?>
</td>
<?php endforeach;?>
</tr>
<?php $i +=1;?>
<?php endforeach;?>
</table>
<?php }?>